package woaini.wind.bot.chat.dto;

import com.plexpt.chatgpt.entity.chat.Message;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
public class ChatMessage extends Message {

  private LocalDateTime createTime;

  public ChatMessage(String role, String content) {
    super(role, content);
    this.createTime = LocalDateTime.now();
  }
  public ChatMessage(String role, String content,LocalDateTime createTime) {
    super(role, content);
    this.createTime = createTime;
  }
  public static ChatMessage of(String content) {
    return new ChatMessage(Message.Role.USER.getValue(), content);
  }

  public static ChatMessage ofSystem(String content) {
    return new ChatMessage(Role.SYSTEM.getValue(), content);
  }

  public static ChatMessage ofAssistant(String content) {
    return new ChatMessage(Role.ASSISTANT.getValue(), content);
  }
}
